<?php

/**
 * Navigation for admin subpages.
 *
 * @author Honza
 */
class NavigationAdmin implements ISubNavigation {
  public static function getContent() {
    if (!isset($_GET[self::SUBKEY])) {
      return self::getDefault();
    }
    
    $iMainBody = NULL;
    
    switch ($_GET[self::SUBKEY]) {
      case 'authors':
        $iMainBody = new ContentAdminAuthors();
        break;
      case 'genres':
        $iMainBody = new ContentAdminGenres();
        break;
      case 'langs':
        $iMainBody = new ContentAdminLanguages();
        break;
      case 'users':
        $iMainBody = new ContentAdminUsers();
        break;
      case 'locations':
        $iMainBody = new ContentAdminLocations();
        break;
      default:
        return self::getDefault();
        break;
    }

    return self::wrap($iMainBody);
  }

  public static function getDefault() {
    return self::wrap(new ContentAdminAuthors());
  }
  
  private static function wrap($iMainBody) {
    return MainBody::getMainBodyContent($iMainBody);
  }
}

?>
